{assign name="cover" value="$info.cover_id ?? ''|get_cover='path'" /}
<div class="section">
    <div id="articlePicture"></div>
    <input type="hidden" name="cover_id" id="cover_id" value="{$info.cover_id ?? ''}"/>
    {notempty name="info.cover_id"}
    <div class="upload-pre-item" >
        <ul class="h5_upload_ul">
            <li>
                <a class="fancybox_one" href="{$cover ?? ''}">
                    <img src="{$cover ?? ''}" height="114" width="185" alt="" />
                </a>
                <a href="javascript:void(0);" class="each" data="" id="del_img"></a>
            </li>
        </ul>
    </div>
    {/notempty}
</div>
<script type="text/javascript">
    $(function () {
        $('.fancybox_one').fancybox({padding: 5, openEffect: 'elastic', openSpeed: 150, closeEffect: 'elastic', closeSpeed: 150, helpers: {}});
        var itemTemp = '<li><div id="${fileID}" class="uploadify-queue-item"><div class="img_height" id="${imags}"></div> <div class="uploadify-progress"><div class="uploadify-progress-bar"></div></div><a href="javascript:void(0);" class="uploadbtn">上传</a><a href="javascript:void(0);" class="delfilebtn">删除</a><font id="message" class="${meg}"></font></div></li>';
        var up = $("#articlePicture").Huploadify({fileObjName: "articlePicture", buttonTemp: "", uploadOne: true, itemTemplate: itemTemp, auto: false, multi: false, inputValue: 'cover_id', fileSizeLimit: 2048, showUploadedPercent: true, showUploadedSize: true, uploader: "{:\\think\\Url::build('Article/articlePicture')}",
            onUploadSuccess: function (file, data) {
                var data = $.parseJSON(data);
                $(".message_" + file.index + "").text(data.msg);
            }, onUploadError: function (file, data) {
                var data = $.parseJSON(data);
                $(".message_" + file.index + "").text(data.msg);
            }, onUploadComplete: function (file, data) {
                var data = $.parseJSON(data);
                $("#cover_id").val(data.data);
            }});
        $('#del_img').click(function () {
            $('.upload-pre-item').remove();
            $("input[name=cover_id]").val('');
        });
    });
</script>